package com.itheima.dao.impl;

import com.itheima.dao.AccountDao;
import org.apache.commons.dbutils.QueryRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public class AccountDaoImpl implements AccountDao {
    @Autowired
    private QueryRunner queryRunner;
    @Override
    public void update() throws SQLException {

        String sql = "update tal_account set username = ? , money = ? where id = ?";

        Object[] params = {"柳长街",3000,2};

        queryRunner.update(sql,params);
    }

    public void setQueryRunner(QueryRunner queryRunner) {
        this.queryRunner = queryRunner;
    }
}
